package com.study.enums;

import com.study.pojo.common.IResult;
import lombok.Getter;

@Getter
public enum ResultCodeEnum implements IResult {
    SUCCESS(1000, "请求成功"),
    FAILED(1001, "请求失败"),
    VALIDATE_ERROR(1002, "参数校验失败"),
    FORBIDDEN(2004, "没有权限访问资源"),
    UNSUPPORTED_REQUEST(4000, "不支持的请求"),
    USERNAME_ALREADY_EXISTS(1005, "用户名已存在"),
    EXISTING_COUPLE(1006, "Ta有对象了"),
    LINK_SUCCESS(1007, "恋接成功"),
    UPDATE_SUCCESSFULLY(1008, "更新成功"),
    QUERY_SUCCESS(1009, "查询成功"),
    QUERY_FAILURE(1010, "查询失败"),
    CHANGE_SUCCESS(1011, "修改成功"),
    CHANGE_FAILED(1012, "修改失败"),
    SAVE_SUCCESS(1013, "保存成功"),
    SAVE_FAILURE(1014, "保存失败"),
    DELETE_SUCCESS(1015, "删除成功"),
    DELETE_FAILURE(1016, "删除失败"),
    RECEIVE_SUCCESSFULLY(1017, "领取成功"),
    RECEIVE_FAILURE(1018, "领取失败"),
    RESPONSE_PACK_ERROR(1003, "response返回包装失败");


    private final Integer code;
    private final String msg;

    ResultCodeEnum(Integer code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    @Override
    public int getCode() {
        return this.code;
    }

    @Override
    public String getMsg() {
        return this.msg;
    }
}
